package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entity.CommonResult;
import com.atguigu.springcloud.service.StorageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @NAME: StorageController
 * @USER: Administrator
 * @DESCRIPTION:
 **/
@RestController
public class StorageController {

    @Resource
    StorageService storageService;

    @PostMapping("/storage/delcreate")
    CommonResult delcreate(@RequestParam("productId") Long productId, @RequestParam("count") Integer count){
        storageService.delcreate(productId,count);
        return new CommonResult(20,"扣减库存完成！");
    }
}
